
package com.phm.phmneuron.connection;

import com.phm.phmneuron.neuron.Neuron;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;

/**
 *
 * @author PARHAM
 */
public class NeuronConnectionsContainer extends ConnectionsContainer 
                                        implements Cloneable {
    
    protected final Neuron host;
    
//    protected NeuronConnectionsContainer () {
//    
//    }
    public NeuronConnectionsContainer (Neuron neuron) {
        host = Objects.requireNonNull(neuron);
    }
    public List<Neuron> getNeighbors () {
        return getNeighbors(host);
    }
    
    @Override
    public boolean add (Connection c) {
        if (c != null && c.include(host)) {
            return add(c);
        }
        return false;
    }
    @Override
    public Object clone () {
        NeuronConnectionsContainer c = new NeuronConnectionsContainer(host);
        c.addAll(this);
        return c;
    }
}
